//app.js
App({
  onShow: function () {
  },
  onLaunch: function (options) {
    var that = this
    wx.getSystemInfo({
      success: e => {
        this.globalData.StatusBar = e.statusBarHeight;      //获取状态栏的高度
        let custom = wx.getMenuButtonBoundingClientRect();  //获取菜单按钮（右上角胶囊按钮）的布局位置信息
        this.globalData.Custom = custom;
        this.globalData.CustomBar = custom.bottom + custom.top - e.statusBarHeight;   //导航栏的高度
      }
    })
    wx.getSystemInfo({
      success: (res) => {
        this.globalData.height = res.statusBarHeight
      }
    }) 
    //0团购商品
    const userInfo = wx.getStorageSync("authKey");
    // 获取用户信息
    if (userInfo) {
      that.globalData.userInfo = userInfo
    } else {
      if (options.query.id) {
        let id = options.query.id
      } else {
        let id = ''
      }
      if (options.query.type) {
        let type = options.query.type
        // wx.reLaunch({
        // url: 'pages/logs/logs?id='+id+'&type='+type
        // })
      } else {
        let type = ''
        // wx.reLaunch({
        //   url: 'pages/logs/logs',
        // })
      }

    }
  },
  onShow: function () {
    var that = this
    wx.getSystemInfo({
      success: res => {
        let modelmes = res.model;
        if (modelmes.search('iPhone X') != -1) {
          that.globalData.isIphoneX = true
        }
      }
    })
  },

  globalData: {
    storeId: null,          //店铺id
    storesIndex:'0',        //首页选择的自提点
    lat: '',                //当前经纬度
    lng: '',                //当前金纬度
    isIphoneX: false,
    logins: '',             //用户是否授权
    userInfo: null,         //用户id
    stastaVip: null,        //0没有1有
    Accept: 'application/prs.zhongmeng.v1+json',
    //tenxunMap: '66NBZ-MHZ6I-53TGA-5ZEPJ-XQIUO-UIBDV',             //腾讯地图api 中盟
    tenxunMap: 'MNVBZ-EWS3G-L2OQM-IBNG5-3DCQH-AIFUJ',               //腾讯地图api 发到家镇宁店
    //tenxunMap:'YM4BZ-6HGCO-IOSWU - SK6VT - RHF7Z - BYBBQ',        //萍乡
    //tenxunMap: 'NVRBZ-NF3HO-FJFWC-SPGQ6-VOZZO-FIFS2',             //永修
    //tenxunMap: 'G5UBZ-JRGWU-PLSVO-24TH5-MYYAH-FABI4',             //永修
    //开发者服务器地址:
    //upImage: 'https://jxzmys.com/app/index.php?i=4&c=entry&m=jrshop&do=mobile&r=',
    upImage: 'https://jxzmys.com/app/index.php?i=2&c=entry&m=jrshop&do=mobile&r=',
    baseUrl:'https://nnx.0791jr.com/app/index.php?c=entry&m=jrshop&do=mobile&r=index.getNearestStoreId'
  }
 
})